<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    

<c:set var="contextPath" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN" "http://www.wapforum.org/DTD/xhtml-mobile11.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
	<link rel="stylesheet" href="${contextPath}/css/common/layout.css" type="text/css" />
	<script type="text/javascript">
		var contextPath = "${contextPath}";
	</script>
	<script type="text/javascript" src="${contextPath}/js/common/lib/jquery-1.6.4.js"></script>
	<script type="text/javascript" src="${contextPath}/js/common/menu.js"></script>
	<script type="text/javascript" src="${contextPath}/js/library.js"></script>
	<link rel="stylesheet" href="${contextPath}/css/library.css" type="text/css" />
	<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-32515688-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
	<title>인권과 평화의 대학 - 성공회대학교</title>
</head>
<body>

	<jsp:include page="./common/header.jsp" />

	<!-- 컨텐츠 시작 -->	
	<div id="center">
	
		<!-- 공통 네비게이션 -->
		<h2>
			<span class="nav_step_3">도서검색</span>
		</h2>
		<!-- 공통 부분 -->
	
		<div id="center_library_search">
			<form action="${contextPath}/library.do" method="post">
				<img id="book_search_title" src="${contextPath}/img/common/book_search.gif" alt="도서검색" />
				<input type="hidden" name="qy_idx" value="TITL" />
				<input type="hidden" name="m_var" value="421" />
				<input type="hidden" name="ssrv_id" value="31" />
				<input type="text" class="qy_kwd" name="qy_kwd" value="${qy_kwd}" />
				<input type="image" value="Search" name="sa" src="${contextPath}/img/common/btn_search1.gif" />
			</form>
		</div>
	
		<c:choose>
			<c:when test="${size > 0}">
				<c:forEach items="${bookList}" var="bookList">
					<c:choose>
						<c:when test="${bookList.img == ''}">
							<dl class="book_no_img">
								<dd class="title">제목:${bookList.title}</dd>
								<dd class="author">저자:${bookList.author}</dd>
								<dd class="publisher">발행:${bookList.publisher}</dd>
								<dd class="year">출판년도:${bookList.year}</dd>
								<dd class="location">소장위치:${bookList.location}</dd>
								<dd>
									<input class="rental" id="${bookList.bookId}" type="submit" value="대출여부확인" /> 
									<div class="rentalYn_${bookList.bookId}"></div>
								</dd>
							</dl>
						</c:when>
						<c:otherwise>
							<dl class="book">
								<dt><img src="${bookList.img}" alt="${bookList.title}" /></dt>				
								<dd class="title">제목:${bookList.title}</dd>
								<dd class="author">저자:${bookList.author}</dd>
								<dd class="publisher">발행:${bookList.publisher}</dd>
								<dd class="year">출판년도:${bookList.year}</dd>
								<dd class="location">소장위치:${bookList.location}</dd>
								<dd>
									<input class="rental" id="${bookList.bookId}" type="submit" value="대출여부확인" />
									<div class="rentalYn_${bookList.bookId}"></div>
								</dd>
							</dl> 
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<dl class="book_no_img">
					<dd class="title">검색 결과가 없습니다.</dd>
				</dl>
			</c:otherwise>
		</c:choose>
				 
		<div id="pagging">
			<a class="first" href="${contextPath}/library.do?curpage=${paggingUtil.first}&amp;qy_kwd=${qy_kwd}">
				<img src="${contextPath}/img/common/board/first.gif" alt="첫 페이지" />
			</a>
			<a class="prev" href="${contextPath}/library.do?curpage=${paggingUtil.prev}&amp;qy_kwd=${qy_kwd}">
				<img src="${contextPath}/img/common/board/prev.gif" alt="이전 페이지" />
			</a>
			
			<c:forEach begin="${paggingUtil.beginPage}" end="${paggingUtil.endPage}" var="num">
				<c:choose>
					<c:when test="${paggingUtil.curPage == num}">
						<a style="font-weight:bold;" href="${contextPath}/library.do?curpage=${num}&amp;qy_kwd=${qy_kwd}">${num}</a>				
					</c:when>
					<c:otherwise>
						<a href="${contextPath}/library.do?curpage=${num}&amp;qy_kwd=${qy_kwd}">${num}</a>
					</c:otherwise>
				</c:choose>
			</c:forEach> 
			
			<a class="next" href="${contextPath}/library.do?curpage=${paggingUtil.next}&amp;qy_kwd=${qy_kwd}">
				<img src="${contextPath}/img/common/board/next.gif" alt="다음 페이지" />
			</a>
			<a class="last" href="${contextPath}/library.do?curpage=${paggingUtil.last}&amp;qy_kwd=${qy_kwd}">
				<img src="${contextPath}/img/common/board/last.gif" alt="마지막 페이지" />
			</a>
		</div> 		 
		
	</div>	
	<!-- 컨텐츠 끝 -->	
	
	<!-- 하단영역 -->
	<jsp:include page="./common/footer.jsp" />
	
			 
</body>
</html>